<?php
class IndexController extends Zend_Controller_Action{
	
	public function init(){
		
	}
	// disable layout
	public function preDispatch(){
		$this->_helper->layout->disableLayout();
		$this->_helper->viewRenderer->setNoRender(true);
		$this->response = $this->getResponse();
		$this->response->setHeader('Content-type', 'application/json;charset=UTF-8', true);
		header('Access-Control-Allow-Origin: *');
	}
	public function indexdAction(){
	}
	public function getGrammarAction(){
		$mModel 		= new Default_Model_Grammar();
		$data 			= $mModel->listItems(null);
		return $this->response->setBody(Zend_Json::encode($data));
	}
	public function getKanjiAction(){
		$mModel 		= new Default_Model_Kanji();
		$data 			= $mModel->listItems(null);
		return $this->response->setBody(Zend_Json::encode($data));
	}
	public function getLessonAction(){
		$mModel 		= new Default_Model_Lesson();
		$data 			= $mModel->listItems(null);
		return $this->response->setBody(Zend_Json::encode($data));
	}
	public function getListeningAction(){
		$mModel 		= new Default_Model_Listening();
		$data 			= $mModel->listItems(null);
		return $this->response->setBody(Zend_Json::encode($data));
	}
	public function getQuestionAction(){
		$mModel 		= new Default_Model_Question();
		$data 			= $mModel->listItems(null);
		return $this->response->setBody(Zend_Json::encode($data));
	}
	public function getReadingAction(){
		$mModel 		= new Default_Model_Reading();
		$data 			= $mModel->listItems(null);
		return $this->response->setBody(Zend_Json::encode($data));
	}
	public function getVocabularyAction(){
		$mModel 		= new Default_Model_Vocabulary();
		$data 			= $mModel->listItems(null);
		return $this->response->setBody(Zend_Json::encode($data));
	}
}